/**
 * UninaDocentiSync - A Java application to synchronize Unina resources
 * Copyright (C) 2011  Fabio Scippacercola (nonplay.programmer@gmail.com)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

package uninadocenti.framework;

/**
 *
 * @author Fabio Scippacercola (nonplay.programmer@gmail.com)
 */
public class WebDocentiFile {

    public WebDocentiFile(String name, String URLpath, String path, boolean isDirectory, boolean topLevel, Insegnamento insegnamento) {
        this.name = name;
        this.URLPath = URLpath;
        this.path = path;
        this.m_isDirectory = isDirectory;
        this.topLevel = topLevel;
        this.insegnamento = insegnamento;
    }

    public Insegnamento getInsegnamento() {
        return insegnamento;
    }

    public boolean isDirectory() {
        return m_isDirectory;
    }

    public String getPath() {
        return path;
    }

    public String getName() {
        return name;
    }

    public String getURLPath() {
        return URLPath;
    }

    public boolean isTopLevel() {
        return topLevel;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final WebDocentiFile other = (WebDocentiFile) obj;
        if ((this.URLPath == null) ? (other.URLPath != null) : !this.URLPath.equals(other.URLPath)) {
            return false;
        }
        if (this.insegnamento != other.insegnamento && (this.insegnamento == null || !this.insegnamento.equals(other.insegnamento))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 29 * hash + (this.URLPath != null ? this.URLPath.hashCode() : 0);
        hash = 29 * hash + (this.insegnamento != null ? this.insegnamento.hashCode() : 0);
        return hash;
    }
    
    private String name;
    private String URLPath;
    private String path;
    private boolean m_isDirectory;
    private boolean topLevel;
    private Insegnamento insegnamento;
}
